#include <REGX52.H>
#include "MatrixLED.h"
#include "DelayTime.h"

void main()
{
	unsigned char pic[] = 
		{
		 0xFF,0x08,0x08,0x08,0xFF,0x00,0x00,0x7E,
		 0x81,0x81,0x81,0x7E,0x00,0x00,0xFF,0x01,
		 0x02,0x00,0x00,0xFF,0x01,0x02,0x00,0x00,
		 0x7E,0x81,0x81,0x81,0x7E,0x00,0x00,0x7A,
		};
	int i = 0;
	int offset = 0; // 
	int cnt = 0;
	_74HC595_Init();
	// 显示一个动画

	while(1)
	{
		for(i = 0; i < 8; i++)
		{
			MatrixLED_ShowColumn(i ,pic[i + offset]);
		}
		cnt++;
		// 第一帧的图片显示超过10次，则进行下一帧
		// 如果是流动播放offset则加1，如果要一帧一帧播放则要+8
		if(cnt > 10)
		{
			offset++;
			cnt=0;
		}
		if(offset >= 24)
		{
			offset = 0;
			
		}
	}
}